package com.zeta.api.client.demo;

import com.zeta.api.model.DemoDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.zetaframework.base.result.ApiResult;

/**
 * SeataDemo2服务 Feign接口
 *
 * @author gcc
 */
@FeignClient(name = "seata-demo2-server", path = "/demo/seata2", fallbackFactory = IDemoSeata2ApiFallbackFactory.class)
public interface IDemoSeata2Api {

    /**
     * 尝试抛异常，测试seata事务回滚
     *
     * @param demoDTO demo表数据
     * @return 测试结果
     */
    @PostMapping("/try")
    ApiResult<Boolean> tryException(@RequestBody DemoDTO demoDTO);

}
